package com.gitee.springboot_userdemo.service.impl;

import com.gitee.springboot_userdemo.domain.User;
import com.gitee.springboot_userdemo.mapper.UserMapper;
import com.gitee.springboot_userdemo.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;


    @Override
    public List<User> selectAll() {

        return userMapper.selectAll();
    }

    @Override
    public void deleteById(int uid) {
        userMapper.deleteById(uid);
    }

    @Override
    public User selectByUid(int uid) {
        return userMapper.selectById(uid);
    }

    @Override
    public void updateUser(User user) {
        userMapper.updateUser(user);
    }

    @Override
    public void addUser(User user) {
        userMapper.addUser(user);
    }
}
